import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import EmptyLayout from '@/layout/empty.vue';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/dashboard',
  },
  {
    path: '/dashboard',
    name: 'dashboard',
    meta: {
      path: '/dashboard',
      title: '首页',
      icon: 'menu',
      order: 1,
    },
    component: EmptyLayout,
    redirect: '/dashboard/index',
    children: [
      {
        path: 'index',
        name: 'dashboardIndex',
        meta: {
          path: '/dashboard/index',
          title: '首页',
          icon: '',
          order: 1,
        },
        component: () => import('@/views/dashboard/index.vue'),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
